﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Axa.CasinoApp.Client.ProcessLayer.WebRequest;

namespace CasinoApp.ProcessLayer.WebRequest
{
    public class WebRequestCheck
    {
        public bool CheckSiteAvailabilty(string url)
        {
            AsyncWebRequestHandler webRequestHandler = new AsyncWebRequestHandler(string.Empty);
            webRequestHandler.RequestCompleted += new EventHandler<ResponseEventArgs>(RequestCompletedHandler);
            webRequestHandler.BeginRequestAsync("www.google.ch");
            //HttpWebRequest request = HttpWebRequest.CreateHttp("http://localhost/myContentSite/test.aspx");
            //HttpWebResponse response = (HttpWebResponse)request.GetResponse();
            //if (response == null || response.StatusCode != HttpStatusCode.OK)
            //{
            //}
            return true;
        }

        private void RequestCompletedHandler(object sender, ResponseEventArgs e)
        {
            
        }
    }
}
